/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.chipchip.chipchipserver;

import com.sun.org.apache.bcel.internal.generic.RET;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import zme.api.exception.ZingMeApiException;
import zme.api.graph.ZME_Me;
import zme.api.graph.ZME_GraphAPI;
import zme.api.graph.ZME_User;


/**
 *
 * @author Tri
 */
public class ZingMeUser {
    private static ZingMeUser instance = null;
    public static ZingMeUser sharedInstance() {
        if(instance == null) {
            instance = new ZingMeUser();
        }
        return instance;
    }
    
    private ZingMeUser() {
        
    }
    
    public HashMap<String,String> getMEInfo(ZME_Me me) throws IOException, ZingMeApiException {  
        // fields: - ZingME user's information. Fields can be 'id','username', 'displayname','tinyurl','profile_url','gender','dob'
        String fieldToRequest = "id, username, displayname";
        return me.getInfo(fieldToRequest);
    }
    
    public ArrayList<String> getFriendsList(ZME_Me me) throws ZingMeApiException, IOException {
        return me.getFriends();
    }
}
